import { defineEventHandler } from 'h3';

export function createWebSocketStatusApi(app) {
  return defineEventHandler(async (event) => {
    if (event.node.req.method === 'GET') {
      return {
        connected: app.webSocketServer.getClientCount() > 0,
        count: app.webSocketServer.getClientCount(),
        clients: app.webSocketServer.getClientsInfo()
      };
    }
  });
} 